﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PoshBuild.ComponentModel;

namespace IronCow.Posh.ComponentModel
{
    [DisplayFormatDescriptor(typeof(TaskList))]
    public class TaskListDisplayFormatDescriptor : IDisplayFormatDescriptor
    {
        #region IDisplayFormatDescriptor Members

        public DisplayFormatAttribute GetDisplayFormatAttribute()
        {
            return new DisplayFormatAttribute();
        }

        public DisplayFormatColumnAttribute GetDisplayFormatColumnAttribute(string propertyName)
        {
            switch (propertyName)
            {
                case "Name":
                    return new DisplayFormatColumnAttribute(0);
                case "Flags":
                    return new DisplayFormatColumnAttribute(1);
                case "Filter":
                    return new DisplayFormatColumnAttribute(2);
                default:
                    return null;
            }
        }

        #endregion
    }
}
